//
//  SPVideoFrameDescription.m
//  SuperPlayer
//
//  Created by cui on 2019/12/25.
//  Copyright © 2019 annidy. All rights reserved.
//

#import "SPVideoFrameDescription.h"
#import "CTSuperPlayerUtil.h"

@implementation SPVideoFrameDescription

+ (instancetype)instanceFromDictionary:(NSDictionary *)dict
{
    if (dict && [dict isKindOfClass:[NSDictionary class]]) {
        SPVideoFrameDescription *desc = [[SPVideoFrameDescription alloc] init];
        desc.time = [[CTSuperPlayerUtil parseNumberValue:dict[@"timeOffset"]] intValue] / 1000.0;
        desc.text = [[CTSuperPlayerUtil parseStringValue:dict[@"content"]] stringByRemovingPercentEncoding];
        return desc;
    }
    return nil;
}

@end
